<template>
  <div>
    <Dialog title="退货详情" :loading="loading" :visible="visible" :reveal="false" class="two-columns" @close="handleClose">
      <!-- <Dialog title="退货详情" :loading="loading" :visible="visible" :reveal="false" @close="handleClose"> -->
      <el-row class="mb-20-y">
        <!-- <el-col :span="6">退货单号：{{ currentRow.dataCode }}</el-col>
        <el-col :span="6">来源：{{ currentRow.source }}</el-col>
        <el-col :span="6">退单人：{{ currentRow.orderMan }}</el-col>
        <el-col :span="6">顾客：{{ currentRow.customerName }}</el-col> -->
        <el-col :span="12" style="line-height:30px">退货单号：{{ currentRow.dataCode }}</el-col>
        <el-col :span="12" style="line-height:30px">来源：{{ currentRow.source }}</el-col>
        <el-col :span="12" style="line-height:30px">退单人：{{ currentRow.orderMan }}</el-col>
        <el-col :span="12" style="line-height:30px">顾客：{{ currentRow.customerName }}</el-col>
      </el-row>
      <el-table :data="currentRow.purchaseOrderDtoList" border :row-class-name="tableColor">
        <el-table-column label="名称" prop="name" show-overflow-tooltip />
        <el-table-column label="类型" prop="type" show-overflow-tooltip />
        <el-table-column label="规格" prop="spec" show-overflow-tooltip />
        <el-table-column label="单位" prop="unit" show-overflow-tooltip />
        <el-table-column label="应退数量" prop="purchaseCount" show-overflow-tooltip />
        <el-table-column label="退货数量" prop="returnCount" show-overflow-tooltip />
      </el-table>
      <el-row style="margin-top:20px">
        <el-col :span="6">仓库：{{ currentRow.warehouseName?currentRow.warehouseName:'无' }}</el-col>
        <el-col v-if="currentRow.status !== '已取消'" :span="6">操作员：{{ currentRow.handler }}</el-col>
        <el-col v-if="currentRow.status !== '已取消'" :span="10">操作时间：{{ currentRow.handDate }}</el-col>
        <el-col v-if="currentRow.status === '已取消'" :span="6">状态：{{ currentRow.status }}</el-col>
      </el-row>
      <!-- </el-row> -->
      <div class="all-margin-bottom" />
    </Dialog>
  </div>
</template>

<script>
// import { mapMutations } from 'vuex';
import Dialog from "@/components/Dialog";
import { tableColor } from '@/utils/common.js';
export default {
  name: "Index",
  components: {
    Dialog,
  },
  props: {
    visible: {
      type: Boolean,
      default: false,
    },
    currentRow: {
      type: Object,
      default: () => {},
    },
    isDetails: {
      type: Boolean,
      default: false,
    },
  },
  data() {
    return {
      tableColor,
      loading: false,
    };
  },
  methods: {
    handleClose() {
      this.$emit('handleClose');
    },
  },
};
</script>

<style scoped lang='scss'>
.mb-20-y{
  margin-bottom: 20px;
}
</style>
